/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Calendar;
import java.util.Date;

/**
 * <p>Project: app2022 - D1
 * <p>Powered by webrx On 2022-01-05 15:22:38
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class D1 {
    public static void main(String[] args) {
        Date d = new Date();
        //d.getTime() 返回long 时间戳
        //1641367465445
        //System.out.println(d.getTime());

        var c = Calendar.getInstance();
        c.set(Calendar.YEAR, 9999);
        //c.set(1, 9999);
        c.set(Calendar.MONTH, 11);
        c.set(Calendar.DATE, 31);
        c.set(11, 23);//hour
        c.set(12, 59);//minute
        c.set(13, 59);//second

        //日历工具类，getTime() 方法返回一个Date对象，转换为Date对象
        Date d2 = c.getTime();

        System.out.println(c.getTimeInMillis());


        System.out.printf("%tF %<tT %<tA%n", c);
        System.out.printf("%tF %<tT %<tA%n", 1641367465445L);
        System.out.printf("%tF %<tT %<tA", 0L);
        System.out.println();

        //2012
        System.out.printf("%tF %<tT %<tA", 253402271999441L);

        //根据时间戳，建立日期对象
        Date d3 = new Date(253402271999441L);
    }
}
